object dmMain: TdmMain
  OldCreateOrder = False
  OnCreate = DataModuleCreate
  Left = 480
  Top = 371
  Height = 458
  Width = 563
  object PgConnection: TPgConnection
    LoginPrompt = False
    AfterConnect = PgConnectionAfterConnect
    Database = 'SKLAD'
    Port = 5433
    Options.UseUnicode = True
    ConnectionTimeout = 30
    SSLOptions.Mode = smPrefer
    Left = 24
    Top = 16
  end
  object qWork: TPgQuery
    Connection = PgConnection
    BeforeOpen = DataSetBeforeOpen
    Left = 24
    Top = 72
  end
  object qWork1: TPgQuery
    Connection = PgConnection
    BeforeOpen = DataSetBeforeOpen
    Left = 24
    Top = 128
  end
  object qReference: TPgQuery
    Connection = PgConnection
    BeforeOpen = DataSetBeforeOpen
    Left = 24
    Top = 184
  end
  object sp: TPgStoredProc
    Connection = PgConnection
    BeforeExecute = spBeforeExecute
    Left = 104
    Top = 16
  end
  object StoredProc: TPgStoredProc
    Connection = PgConnection
    BeforeExecute = spBeforeExecute
    Left = 104
    Top = 80
  end
  object dsWork1: TPgDataSource
    DataSet = qWork1
    Left = 32
    Top = 80
  end
  object qWork2: TPgQuery
    Connection = PgConnection
    BeforeOpen = DataSetBeforeOpen
    Left = 104
    Top = 136
  end
  object dsNomenclature: TPgDataSource
    DataSet = qNomenclature
    Left = 176
    Top = 24
  end
  object qNomenclature: TPgQuery
    Connection = PgConnection
    SQL.Strings = (
      'select nom_id, nom_name '
      ' from "SKLAD".Nomenclatures'
      'order by nom_name')
    BeforeOpen = DataSetBeforeOpen
    Left = 168
    Top = 16
  end
  object dsStuff: TPgDataSource
    DataSet = qStuff
    Left = 176
    Top = 88
  end
  object qStuff: TPgQuery
    Connection = PgConnection
    SQL.Strings = (
      
        'select a.*, (stt_name||'#39' '#39'||trim(stf_thick::varchar(20))||'#39' ('#39'||' +
        'clr_code||'#39', '#39'||prc_name||'#39')'#39')::varchar(200) stf_name'
      ' from "SKLAD"."V$ALLSTUFF" a'
      'order by stt_name')
    BeforeOpen = DataSetBeforeOpen
    Left = 168
    Top = 80
  end
  object dsObject: TPgDataSource
    DataSet = qObject
    Left = 176
    Top = 152
  end
  object qObject: TPgQuery
    Connection = PgConnection
    SQL.Strings = (
      'select obj_id, obj_name, obj_address, obj_datefill'
      ' from "SKLAD".Objects'
      'order by obj_name')
    BeforeOpen = DataSetBeforeOpen
    Left = 168
    Top = 144
  end
  object dsUser: TPgDataSource
    DataSet = qUser
    Left = 176
    Top = 216
  end
  object qUser: TPgQuery
    Connection = PgConnection
    SQL.Strings = (
      'select usr_id, usr_name'
      ' from'
      '     (select USR_ID, USR_NAME, '
      
        '            (select usename from pg_user where usesysid = a.USES' +
        'YSID) usesysname,'
      
        '            (select rolname::varchar(50) from pg_roles where oid' +
        '= a.ROLEID) role_name'
      '      from "SKLAD".Users a) b'
      'where usesysname = current_user'
      'order by usr_name')
    BeforeOpen = DataSetBeforeOpen
    Left = 168
    Top = 208
  end
  object dsParamsLib: TPgDataSource
    DataSet = qParamsLib
    Left = 176
    Top = 280
  end
  object qParamsLib: TPgQuery
    Connection = PgConnection
    BeforeOpen = DataSetBeforeOpen
    Left = 168
    Top = 272
  end
  object dsParams: TPgDataSource
    DataSet = qParams
    Left = 104
    Top = 208
  end
  object qParams: TPgQuery
    Connection = PgConnection
    SQL.Strings = (
      'select p.plc_id, p.lib_name'
      ' from "SKLAD"."V$ALLPARAMS" p '
      ' where p.nom_id = :nom_id'
      'order by nom_name;')
    BeforeOpen = DataSetBeforeOpen
    Left = 96
    Top = 200
    ParamData = <
      item
        DataType = ftInteger
        Name = 'nom_id'
        ParamType = ptInput
      end>
  end
  object qWork3: TPgQuery
    Connection = PgConnection
    BeforeOpen = DataSetBeforeOpen
    Left = 24
    Top = 248
  end
end
